﻿using SWBetongXaydung.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SWBetongXaydung.BLL
{
    class HeThong
    {
        internal static DAL.NguoiSuDung GetNguoiSuDung(string tenDangNhap, string matKhau)
        {
            if (tenDangNhap == null || matKhau == null)
                return null;
            tenDangNhap = tenDangNhap.ToLower();
            if (tenDangNhap == "admin" && matKhau == "admin")
            {
                return new DAL.NguoiSuDung()
                {
                    HoTen = "Nguyễn Văn",
                    TenDangNhap = tenDangNhap,
                    MatKhau = matKhau,
                    VaiTro = NguoiSuDung.VaiTro_QuanTriNguoiDung
                };
            }
            else if (tenDangNhap == "user" && matKhau == "123")
            {
                return new NguoiSuDung()
                {
                    HoTen = "Nguyễn",
                    TenDangNhap = tenDangNhap,
                    MatKhau = matKhau,
                    VaiTro = NguoiSuDung.VaiTro_TacNghiep
                };
            }
            else
                return null;
            //return new DAL.NguoiSuDung()
            //    {
            //        HoTen = "Nguyễn Văn",
            //        TenDangNhap = tenDangNhap,
            //        MatKhau = matKhau,
            //        VaiTro = NguoiSuDung.VaiTro_QuanTriNguoiDung
            //    };
        }
    }
}
